package com.coocaa.x.service.liteuser;

import android.content.ComponentName;
import android.content.Context;
import android.os.IBinder;

import com.coocaa.x.service.XServiceManager.XServiceConnection;
import com.coocaa.x.service.liteuser.aidl.ILiteUserService;

public class LiteUserConnecter extends XServiceConnection<ILiteUserService> {
    private static final String ACTION = "com.coocaa.x.service.liteuser2";
    private static final String CLASS_NAME = "com.coocaa.x.service.liteuser.LiteUserService";

    public static final ComponentName getComponentName(Context context) {
        return new ComponentName(context, CLASS_NAME);
    }

    public static final LiteUserConnecter connecter = new LiteUserConnecter();

    private ILiteUserService service = null;

    public LiteUserConnecter() {
        super(ACTION);
    }

    @Override
    public void onServiceConnected(ComponentName name, IBinder s) {
        service = (ILiteUserService) ILiteUserService.Stub.asInterface(s);
        super.onServiceConnected(name, s);
    }

    @Override
    public void onServiceDisconnected(ComponentName name) {
        service = null;
        super.onServiceDisconnected(name);
    }

    @Override
    protected ILiteUserService _getService() {
        return service;
    }

}